package com.itheima_03;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.InetAddress;
import java.net.Socket;

public class ClientTest1 {
    public static void main(String[] args) throws IOException {
        //InetAddress.getLocalHost().getHostAddress()
        Socket socket = new Socket(InetAddress.getLocalHost().getHostAddress(),10086);
        OutputStream os = socket.getOutputStream();
        //字符转换流
        OutputStreamWriter osw = new OutputStreamWriter(os);
        //转高效
        BufferedWriter bw = new BufferedWriter(osw);

        bw.write("你好!");
        bw.flush();
        socket.close();


    }
}
